import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        String[] words = new String[n];

        for (int i = 0; i < n; i++) {
            words[i] = scanner.nextLine();
        }

        Solution solution = new Solution();
        solution.removeAnagrams(words);
    }

    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        List<Integer> num = new ArrayList<Integer>(n);

        for (int i = 0; i < n; i++) {
            num.add(scanner.nextInt());
        }

        Solution1 solution = new Solution1();
        solution.hasIncreasingSubarrays(num,k);
    }
}

class Solution1 {
    public boolean hasIncreasingSubarrays(List<Integer> nums, int k) {
        if(k == 1){
            return true;
        }
        int n = nums.size();
        for (int i = 0; i <= n - k * 2; i++) {
            boolean flag = true;
            for (int j = i; j < i + k - 1; j++) {
                if(nums.get(j) >= nums.get(j + 1)){
                    flag = false;
                    break;
                }
            }
            for (int j = i + k; j < i + k * 2 - 1; j++) {
                if(nums.get(j) >= nums.get(j + 1)){
                    flag = false;
                    break;
                }
            }
            if (flag){
                return true;
            }
        }
        return false;
    }
}

class Solution {
    public List<String> removeAnagrams(String[] words) {
        List<String> res = new ArrayList<String>();
        int n = words.length;
        char[][] array = new char[n][];

        for (int i = 0; i < n; i++) {
            res.add(words[i]);
            array[i] = words[i].toCharArray();
            Arrays.sort(array[i]);
        }

        for (int i = 0; i < n - 1; i++) {
            for (int j = i + 1; j < n; j++) {
                if(Arrays.equals(array[i], array[j])){
                    words[j] = null;
                }else{
                    break;
                }
            }
        }

        for (int i = n - 1; i >= 0; i--) {
            if(words[i] == null){
                res.remove(i);
            }
        }

        return res;
    }
}